
[dbo].[InventoryTransactionLogCost]
CREATE TABLE [dbo].[InventoryTransactionLogCost]
(
[InventoryTransactionLogCostKey] [uniqueidentifier] NOT NULL,
[InventoryTransactionLogKey] [uniqueidentifier] NOT NULL,
[ProductKey] [uniqueidentifier] NOT NULL,
[Quantity] [decimal] (18, 8) NOT NULL,
[TotalCost] [decimal] (18, 4) NOT NULL,
[QuantityReturned] [decimal] (18, 8) NOT NULL,
[SortOrder] [int] NOT NULL,
[CostMethodCode] [int] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InventoryTransactionLogCost] ADD CONSTRAINT [PK_InventoryTransactionLogCost] PRIMARY KEY CLUSTERED ([InventoryTransactionLogCostKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InvetoryTransactionLogCost_InventoryTransactionLogKey] ON [dbo].[InventoryTransactionLogCost] ([InventoryTransactionLogKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InvetoryTransactionLogCost_ProductKey] ON [dbo].[InventoryTransactionLogCost] ([ProductKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InventoryTransactionLogCost] ADD CONSTRAINT [FK_InventoryTransactionCost_InventoryTransactionMain] FOREIGN KEY ([InventoryTransactionLogKey]) REFERENCES [dbo].[InventoryTransactionLogMain] ([InventoryTransactionLogKey])
GO
ALTER TABLE [dbo].[InventoryTransactionLogCost] ADD CONSTRAINT [FK_InventoryTransactionLogCost_CostMethodRef] FOREIGN KEY ([CostMethodCode]) REFERENCES [dbo].[CostMethodRef] ([CostMethodCode])
GO